#version 460 core
#include "fadeOut.glsl"
out vec4 FragColor;
in vec3 position;

uniform float fadeEndZ;
uniform float fadeZOffset;

struct Edge {
	float upY;
	vec3 sideColor;
};
uniform Edge edge;

uniform vec3 color;

void main()
{
	vec3 _color;
	if (position.y < edge.upY - 0.000001)
		_color = edge.sideColor;
	else
		_color = color;
	FragColor = vec4(fadeOutEdge(_color, fadeEndZ, fadeZOffset, position.z), 1.0);
}